/*
 *
 *    Copyright (c) 2022 Project CHIP Authors
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

// THIS FILE IS GENERATED BY ZAP

#import "MCCommandPayloads_Internal.h"

#import "../MCAttribute_Internal.h"
#import "../MCCastingApp.h"
#import "../MCErrorUtils.h"
#import "../NSDataSpanConversion.h"
#import "../NSStringSpanConversion.h"

#include <app/data-model/Decode.h>
#include <app/data-model/ListLargeSystemExtensions.h>

NS_ASSUME_NONNULL_BEGIN

@implementation MCAbstractPayload
- (std::any)getCppRequestFromObjCRequest
{
    return nil;
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    return CHIP_NO_ERROR;
}

- (nonnull id)copyWithZone:(nullable NSZone *)zone
{
    auto other = [[MCAbstractPayload alloc] init];

    return other;
}
@end

// OnOff cluster:

@implementation MCOnOffClusterOffParams
- (instancetype)init
{
    if (self = [super init]) {
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCOnOffClusterOffParams alloc] init];

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::OnOff::Commands::Off::Type cppStruct;
    ListFreer listFreer;

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCOnOffClusterOnParams
- (instancetype)init
{
    if (self = [super init]) {
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCOnOffClusterOnParams alloc] init];

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::OnOff::Commands::On::Type cppStruct;
    ListFreer listFreer;

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCOnOffClusterToggleParams
- (instancetype)init
{
    if (self = [super init]) {
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCOnOffClusterToggleParams alloc] init];

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::OnOff::Commands::Toggle::Type cppStruct;
    ListFreer listFreer;

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCOnOffClusterOffWithEffectParams
- (instancetype)init
{
    if (self = [super init]) {

        _effectIdentifier = @(0);

        _effectVariant = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCOnOffClusterOffWithEffectParams alloc] init];

    other.effectIdentifier = self.effectIdentifier;
    other.effectVariant = self.effectVariant;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: effectIdentifier:%@; effectVariant:%@; >", NSStringFromClass([self class]), _effectIdentifier, _effectVariant];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::OnOff::Commands::OffWithEffect::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.effectIdentifier = static_cast<std::remove_reference_t<decltype(cppStruct.effectIdentifier)>>(self.effectIdentifier.unsignedCharValue);
    }
    {
        cppStruct.effectVariant = self.effectVariant.unsignedCharValue;
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCOnOffClusterOnWithRecallGlobalSceneParams
- (instancetype)init
{
    if (self = [super init]) {
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCOnOffClusterOnWithRecallGlobalSceneParams alloc] init];

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type cppStruct;
    ListFreer listFreer;

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCOnOffClusterOnWithTimedOffParams
- (instancetype)init
{
    if (self = [super init]) {

        _onOffControl = @(0);

        _onTime = @(0);

        _offWaitTime = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCOnOffClusterOnWithTimedOffParams alloc] init];

    other.onOffControl = self.onOffControl;
    other.onTime = self.onTime;
    other.offWaitTime = self.offWaitTime;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: onOffControl:%@; onTime:%@; offWaitTime:%@; >", NSStringFromClass([self class]), _onOffControl, _onTime, _offWaitTime];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.onOffControl = static_cast<std::remove_reference_t<decltype(cppStruct.onOffControl)>>(self.onOffControl.unsignedCharValue);
    }
    {
        cppStruct.onTime = self.onTime.unsignedShortValue;
    }
    {
        cppStruct.offWaitTime = self.offWaitTime.unsignedShortValue;
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

// LevelControl cluster:

@implementation MCLevelControlClusterMoveToLevelParams
- (instancetype)init
{
    if (self = [super init]) {

        _level = @(0);

        _transitionTime = nil;

        _optionsMask = @(0);

        _optionsOverride = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCLevelControlClusterMoveToLevelParams alloc] init];

    other.level = self.level;
    other.transitionTime = self.transitionTime;
    other.optionsMask = self.optionsMask;
    other.optionsOverride = self.optionsOverride;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: level:%@; transitionTime:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _level, _transitionTime, _optionsMask, _optionsOverride];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.level = self.level.unsignedCharValue;
    }
    {
        if (self.transitionTime == nil) {
            cppStruct.transitionTime.SetNull();
        } else {
            auto & nonNullValue_0 = cppStruct.transitionTime.SetNonNull();
            nonNullValue_0 = self.transitionTime.unsignedShortValue;
        }
    }
    {
        cppStruct.optionsMask = static_cast<std::remove_reference_t<decltype(cppStruct.optionsMask)>>(self.optionsMask.unsignedCharValue);
    }
    {
        cppStruct.optionsOverride = static_cast<std::remove_reference_t<decltype(cppStruct.optionsOverride)>>(self.optionsOverride.unsignedCharValue);
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCLevelControlClusterMoveParams
- (instancetype)init
{
    if (self = [super init]) {

        _moveMode = @(0);

        _rate = nil;

        _optionsMask = @(0);

        _optionsOverride = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCLevelControlClusterMoveParams alloc] init];

    other.moveMode = self.moveMode;
    other.rate = self.rate;
    other.optionsMask = self.optionsMask;
    other.optionsOverride = self.optionsOverride;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: moveMode:%@; rate:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _moveMode, _rate, _optionsMask, _optionsOverride];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::LevelControl::Commands::Move::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.moveMode = static_cast<std::remove_reference_t<decltype(cppStruct.moveMode)>>(self.moveMode.unsignedCharValue);
    }
    {
        if (self.rate == nil) {
            cppStruct.rate.SetNull();
        } else {
            auto & nonNullValue_0 = cppStruct.rate.SetNonNull();
            nonNullValue_0 = self.rate.unsignedCharValue;
        }
    }
    {
        cppStruct.optionsMask = static_cast<std::remove_reference_t<decltype(cppStruct.optionsMask)>>(self.optionsMask.unsignedCharValue);
    }
    {
        cppStruct.optionsOverride = static_cast<std::remove_reference_t<decltype(cppStruct.optionsOverride)>>(self.optionsOverride.unsignedCharValue);
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCLevelControlClusterStepParams
- (instancetype)init
{
    if (self = [super init]) {

        _stepMode = @(0);

        _stepSize = @(0);

        _transitionTime = nil;

        _optionsMask = @(0);

        _optionsOverride = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCLevelControlClusterStepParams alloc] init];

    other.stepMode = self.stepMode;
    other.stepSize = self.stepSize;
    other.transitionTime = self.transitionTime;
    other.optionsMask = self.optionsMask;
    other.optionsOverride = self.optionsOverride;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: stepMode:%@; stepSize:%@; transitionTime:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _stepMode, _stepSize, _transitionTime, _optionsMask, _optionsOverride];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::LevelControl::Commands::Step::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.stepMode = static_cast<std::remove_reference_t<decltype(cppStruct.stepMode)>>(self.stepMode.unsignedCharValue);
    }
    {
        cppStruct.stepSize = self.stepSize.unsignedCharValue;
    }
    {
        if (self.transitionTime == nil) {
            cppStruct.transitionTime.SetNull();
        } else {
            auto & nonNullValue_0 = cppStruct.transitionTime.SetNonNull();
            nonNullValue_0 = self.transitionTime.unsignedShortValue;
        }
    }
    {
        cppStruct.optionsMask = static_cast<std::remove_reference_t<decltype(cppStruct.optionsMask)>>(self.optionsMask.unsignedCharValue);
    }
    {
        cppStruct.optionsOverride = static_cast<std::remove_reference_t<decltype(cppStruct.optionsOverride)>>(self.optionsOverride.unsignedCharValue);
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCLevelControlClusterStopParams
- (instancetype)init
{
    if (self = [super init]) {

        _optionsMask = @(0);

        _optionsOverride = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCLevelControlClusterStopParams alloc] init];

    other.optionsMask = self.optionsMask;
    other.optionsOverride = self.optionsOverride;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _optionsMask, _optionsOverride];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::LevelControl::Commands::Stop::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.optionsMask = static_cast<std::remove_reference_t<decltype(cppStruct.optionsMask)>>(self.optionsMask.unsignedCharValue);
    }
    {
        cppStruct.optionsOverride = static_cast<std::remove_reference_t<decltype(cppStruct.optionsOverride)>>(self.optionsOverride.unsignedCharValue);
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCLevelControlClusterMoveToLevelWithOnOffParams
- (instancetype)init
{
    if (self = [super init]) {

        _level = @(0);

        _transitionTime = nil;

        _optionsMask = @(0);

        _optionsOverride = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCLevelControlClusterMoveToLevelWithOnOffParams alloc] init];

    other.level = self.level;
    other.transitionTime = self.transitionTime;
    other.optionsMask = self.optionsMask;
    other.optionsOverride = self.optionsOverride;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: level:%@; transitionTime:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _level, _transitionTime, _optionsMask, _optionsOverride];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.level = self.level.unsignedCharValue;
    }
    {
        if (self.transitionTime == nil) {
            cppStruct.transitionTime.SetNull();
        } else {
            auto & nonNullValue_0 = cppStruct.transitionTime.SetNonNull();
            nonNullValue_0 = self.transitionTime.unsignedShortValue;
        }
    }
    {
        cppStruct.optionsMask = static_cast<std::remove_reference_t<decltype(cppStruct.optionsMask)>>(self.optionsMask.unsignedCharValue);
    }
    {
        cppStruct.optionsOverride = static_cast<std::remove_reference_t<decltype(cppStruct.optionsOverride)>>(self.optionsOverride.unsignedCharValue);
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCLevelControlClusterMoveWithOnOffParams
- (instancetype)init
{
    if (self = [super init]) {

        _moveMode = @(0);

        _rate = nil;

        _optionsMask = @(0);

        _optionsOverride = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCLevelControlClusterMoveWithOnOffParams alloc] init];

    other.moveMode = self.moveMode;
    other.rate = self.rate;
    other.optionsMask = self.optionsMask;
    other.optionsOverride = self.optionsOverride;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: moveMode:%@; rate:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _moveMode, _rate, _optionsMask, _optionsOverride];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.moveMode = static_cast<std::remove_reference_t<decltype(cppStruct.moveMode)>>(self.moveMode.unsignedCharValue);
    }
    {
        if (self.rate == nil) {
            cppStruct.rate.SetNull();
        } else {
            auto & nonNullValue_0 = cppStruct.rate.SetNonNull();
            nonNullValue_0 = self.rate.unsignedCharValue;
        }
    }
    {
        cppStruct.optionsMask = static_cast<std::remove_reference_t<decltype(cppStruct.optionsMask)>>(self.optionsMask.unsignedCharValue);
    }
    {
        cppStruct.optionsOverride = static_cast<std::remove_reference_t<decltype(cppStruct.optionsOverride)>>(self.optionsOverride.unsignedCharValue);
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCLevelControlClusterStepWithOnOffParams
- (instancetype)init
{
    if (self = [super init]) {

        _stepMode = @(0);

        _stepSize = @(0);

        _transitionTime = nil;

        _optionsMask = @(0);

        _optionsOverride = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCLevelControlClusterStepWithOnOffParams alloc] init];

    other.stepMode = self.stepMode;
    other.stepSize = self.stepSize;
    other.transitionTime = self.transitionTime;
    other.optionsMask = self.optionsMask;
    other.optionsOverride = self.optionsOverride;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: stepMode:%@; stepSize:%@; transitionTime:%@; optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _stepMode, _stepSize, _transitionTime, _optionsMask, _optionsOverride];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.stepMode = static_cast<std::remove_reference_t<decltype(cppStruct.stepMode)>>(self.stepMode.unsignedCharValue);
    }
    {
        cppStruct.stepSize = self.stepSize.unsignedCharValue;
    }
    {
        if (self.transitionTime == nil) {
            cppStruct.transitionTime.SetNull();
        } else {
            auto & nonNullValue_0 = cppStruct.transitionTime.SetNonNull();
            nonNullValue_0 = self.transitionTime.unsignedShortValue;
        }
    }
    {
        cppStruct.optionsMask = static_cast<std::remove_reference_t<decltype(cppStruct.optionsMask)>>(self.optionsMask.unsignedCharValue);
    }
    {
        cppStruct.optionsOverride = static_cast<std::remove_reference_t<decltype(cppStruct.optionsOverride)>>(self.optionsOverride.unsignedCharValue);
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCLevelControlClusterStopWithOnOffParams
- (instancetype)init
{
    if (self = [super init]) {

        _optionsMask = @(0);

        _optionsOverride = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCLevelControlClusterStopWithOnOffParams alloc] init];

    other.optionsMask = self.optionsMask;
    other.optionsOverride = self.optionsOverride;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: optionsMask:%@; optionsOverride:%@; >", NSStringFromClass([self class]), _optionsMask, _optionsOverride];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.optionsMask = static_cast<std::remove_reference_t<decltype(cppStruct.optionsMask)>>(self.optionsMask.unsignedCharValue);
    }
    {
        cppStruct.optionsOverride = static_cast<std::remove_reference_t<decltype(cppStruct.optionsOverride)>>(self.optionsOverride.unsignedCharValue);
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCLevelControlClusterMoveToClosestFrequencyParams
- (instancetype)init
{
    if (self = [super init]) {

        _frequency = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCLevelControlClusterMoveToClosestFrequencyParams alloc] init];

    other.frequency = self.frequency;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: frequency:%@; >", NSStringFromClass([self class]), _frequency];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::LevelControl::Commands::MoveToClosestFrequency::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.frequency = self.frequency.unsignedShortValue;
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

// WakeOnLan cluster:

// TargetNavigator cluster:

@implementation MCTargetNavigatorClusterNavigateTargetParams
- (instancetype)init
{
    if (self = [super init]) {

        _target = @(0);

        _data = nil;
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCTargetNavigatorClusterNavigateTargetParams alloc] init];

    other.target = self.target;
    other.data = self.data;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: target:%@; data:%@; >", NSStringFromClass([self class]), _target, _data];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.target = self.target.unsignedCharValue;
    }
    {
        if (self.data != nil) {
            auto & definedValue_0 = cppStruct.data.Emplace();
            definedValue_0 = AsCharSpan(self.data);
        }
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCTargetNavigatorClusterNavigateTargetResponseParams
- (instancetype)init
{
    if (self = [super init]) {

        _status = @(0);

        _data = nil;
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCTargetNavigatorClusterNavigateTargetResponseParams alloc] init];

    other.status = self.status;
    other.data = self.data;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    // Default implementation
    return CHIP_NO_ERROR;
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse
{
    std::shared_ptr<const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType> responseSharedPtr = std::any_cast<std::shared_ptr<const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType>>(cppResponse);
    const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType cppDecodableStruct = *responseSharedPtr;

    {
        self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)];
    }
    {
        if (cppDecodableStruct.data.HasValue()) {
            self.data = AsString(cppDecodableStruct.data.Value());
            if (self.data == nil) {
                CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT;
                return err;
            }
        } else {
            self.data = nil;
        }
    }
    return CHIP_NO_ERROR;
}
@end

// MediaPlayback cluster:

@implementation MCMediaPlaybackClusterPlayParams
- (instancetype)init
{
    if (self = [super init]) {
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterPlayParams alloc] init];

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::Play::Type cppStruct;
    ListFreer listFreer;

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterPauseParams
- (instancetype)init
{
    if (self = [super init]) {
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterPauseParams alloc] init];

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::Pause::Type cppStruct;
    ListFreer listFreer;

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterStopParams
- (instancetype)init
{
    if (self = [super init]) {
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterStopParams alloc] init];

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::Stop::Type cppStruct;
    ListFreer listFreer;

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterStartOverParams
- (instancetype)init
{
    if (self = [super init]) {
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterStartOverParams alloc] init];

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::StartOver::Type cppStruct;
    ListFreer listFreer;

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterPreviousParams
- (instancetype)init
{
    if (self = [super init]) {
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterPreviousParams alloc] init];

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::Previous::Type cppStruct;
    ListFreer listFreer;

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterNextParams
- (instancetype)init
{
    if (self = [super init]) {
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterNextParams alloc] init];

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::Next::Type cppStruct;
    ListFreer listFreer;

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterRewindParams
- (instancetype)init
{
    if (self = [super init]) {

        _audioAdvanceUnmuted = nil;
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterRewindParams alloc] init];

    other.audioAdvanceUnmuted = self.audioAdvanceUnmuted;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioAdvanceUnmuted:%@; >", NSStringFromClass([self class]), _audioAdvanceUnmuted];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::Rewind::Type cppStruct;
    ListFreer listFreer;
    {
        if (self.audioAdvanceUnmuted != nil) {
            auto & definedValue_0 = cppStruct.audioAdvanceUnmuted.Emplace();
            definedValue_0 = self.audioAdvanceUnmuted.boolValue;
        }
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterFastForwardParams
- (instancetype)init
{
    if (self = [super init]) {

        _audioAdvanceUnmuted = nil;
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterFastForwardParams alloc] init];

    other.audioAdvanceUnmuted = self.audioAdvanceUnmuted;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioAdvanceUnmuted:%@; >", NSStringFromClass([self class]), _audioAdvanceUnmuted];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::FastForward::Type cppStruct;
    ListFreer listFreer;
    {
        if (self.audioAdvanceUnmuted != nil) {
            auto & definedValue_0 = cppStruct.audioAdvanceUnmuted.Emplace();
            definedValue_0 = self.audioAdvanceUnmuted.boolValue;
        }
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterSkipForwardParams
- (instancetype)init
{
    if (self = [super init]) {

        _deltaPositionMilliseconds = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterSkipForwardParams alloc] init];

    other.deltaPositionMilliseconds = self.deltaPositionMilliseconds;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: deltaPositionMilliseconds:%@; >", NSStringFromClass([self class]), _deltaPositionMilliseconds];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::SkipForward::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.deltaPositionMilliseconds = self.deltaPositionMilliseconds.unsignedLongLongValue;
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterSkipBackwardParams
- (instancetype)init
{
    if (self = [super init]) {

        _deltaPositionMilliseconds = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterSkipBackwardParams alloc] init];

    other.deltaPositionMilliseconds = self.deltaPositionMilliseconds;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: deltaPositionMilliseconds:%@; >", NSStringFromClass([self class]), _deltaPositionMilliseconds];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.deltaPositionMilliseconds = self.deltaPositionMilliseconds.unsignedLongLongValue;
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterPlaybackResponseParams
- (instancetype)init
{
    if (self = [super init]) {

        _status = @(0);

        _data = nil;
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterPlaybackResponseParams alloc] init];

    other.status = self.status;
    other.data = self.data;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    // Default implementation
    return CHIP_NO_ERROR;
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse
{
    std::shared_ptr<const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType> responseSharedPtr = std::any_cast<std::shared_ptr<const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType>>(cppResponse);
    const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType cppDecodableStruct = *responseSharedPtr;

    {
        self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)];
    }
    {
        if (cppDecodableStruct.data.HasValue()) {
            self.data = AsString(cppDecodableStruct.data.Value());
            if (self.data == nil) {
                CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT;
                return err;
            }
        } else {
            self.data = nil;
        }
    }
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterSeekParams
- (instancetype)init
{
    if (self = [super init]) {

        _position = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterSeekParams alloc] init];

    other.position = self.position;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: position:%@; >", NSStringFromClass([self class]), _position];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::Seek::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.position = self.position.unsignedLongLongValue;
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterActivateAudioTrackParams
- (instancetype)init
{
    if (self = [super init]) {

        _trackID = @"";

        _audioOutputIndex = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterActivateAudioTrackParams alloc] init];

    other.trackID = self.trackID;
    other.audioOutputIndex = self.audioOutputIndex;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: trackID:%@; audioOutputIndex:%@; >", NSStringFromClass([self class]), _trackID, _audioOutputIndex];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.trackID = AsCharSpan(self.trackID);
    }
    {
        cppStruct.audioOutputIndex = self.audioOutputIndex.unsignedCharValue;
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterActivateTextTrackParams
- (instancetype)init
{
    if (self = [super init]) {

        _trackID = @"";
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterActivateTextTrackParams alloc] init];

    other.trackID = self.trackID;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: trackID:%@; >", NSStringFromClass([self class]), _trackID];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.trackID = AsCharSpan(self.trackID);
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCMediaPlaybackClusterDeactivateTextTrackParams
- (instancetype)init
{
    if (self = [super init]) {
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCMediaPlaybackClusterDeactivateTextTrackParams alloc] init];

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Type cppStruct;
    ListFreer listFreer;

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

// KeypadInput cluster:

@implementation MCKeypadInputClusterSendKeyParams
- (instancetype)init
{
    if (self = [super init]) {

        _keyCode = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCKeypadInputClusterSendKeyParams alloc] init];

    other.keyCode = self.keyCode;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: keyCode:%@; >", NSStringFromClass([self class]), _keyCode];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::KeypadInput::Commands::SendKey::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.keyCode = static_cast<std::remove_reference_t<decltype(cppStruct.keyCode)>>(self.keyCode.unsignedCharValue);
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCKeypadInputClusterSendKeyResponseParams
- (instancetype)init
{
    if (self = [super init]) {

        _status = @(0);
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCKeypadInputClusterSendKeyResponseParams alloc] init];

    other.status = self.status;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; >", NSStringFromClass([self class]), _status];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    // Default implementation
    return CHIP_NO_ERROR;
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse
{
    std::shared_ptr<const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType> responseSharedPtr = std::any_cast<std::shared_ptr<const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType>>(cppResponse);
    const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType cppDecodableStruct = *responseSharedPtr;

    {
        self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)];
    }
    return CHIP_NO_ERROR;
}
@end

// ContentLauncher cluster:

@implementation MCContentLauncherClusterLaunchContentParams
- (instancetype)init
{
    if (self = [super init]) {

        _search = [MCContentLauncherClusterContentSearchStruct new];

        _autoPlay = @(0);

        _data = nil;

        _playbackPreferences = nil;

        _useCurrentContext = nil;
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCContentLauncherClusterLaunchContentParams alloc] init];

    other.search = self.search;
    other.autoPlay = self.autoPlay;
    other.data = self.data;
    other.playbackPreferences = self.playbackPreferences;
    other.useCurrentContext = self.useCurrentContext;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: search:%@; autoPlay:%@; data:%@; playbackPreferences:%@; useCurrentContext:%@; >", NSStringFromClass([self class]), _search, _autoPlay, _data, _playbackPreferences, _useCurrentContext];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type cppStruct;
    ListFreer listFreer;
    {
        {
            using ListType_1 = std::remove_reference_t<decltype(cppStruct.search.parameterList)>;
            using ListMemberType_1 = ListMemberTypeGetter<ListType_1>::Type;
            if (self.search.parameterList.count != 0) {
                auto * listHolder_1 = new ListHolder<ListMemberType_1>(self.search.parameterList.count);
                if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) {
                    return CHIP_ERROR_INVALID_ARGUMENT;
                }
                listFreer.add(listHolder_1);
                for (size_t i_1 = 0; i_1 < self.search.parameterList.count; ++i_1) {
                    if (![self.search.parameterList[i_1] isKindOfClass:[MCContentLauncherClusterParameterStruct class]]) {
                        // Wrong kind of value.
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    auto element_1 = (MCContentLauncherClusterParameterStruct *) self.search.parameterList[i_1];
                    listHolder_1->mList[i_1].type = static_cast<std::remove_reference_t<decltype(listHolder_1->mList[i_1].type)>>(element_1.type.unsignedCharValue);
                    listHolder_1->mList[i_1].value = AsCharSpan(element_1.value);
                    if (element_1.externalIDList != nil) {
                        auto & definedValue_3 = listHolder_1->mList[i_1].externalIDList.Emplace();
                        {
                            using ListType_4 = std::remove_reference_t<decltype(definedValue_3)>;
                            using ListMemberType_4 = ListMemberTypeGetter<ListType_4>::Type;
                            if (element_1.externalIDList.count != 0) {
                                auto * listHolder_4 = new ListHolder<ListMemberType_4>(element_1.externalIDList.count);
                                if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) {
                                    return CHIP_ERROR_INVALID_ARGUMENT;
                                }
                                listFreer.add(listHolder_4);
                                for (size_t i_4 = 0; i_4 < element_1.externalIDList.count; ++i_4) {
                                    if (![element_1.externalIDList[i_4] isKindOfClass:[MCContentLauncherClusterAdditionalInfoStruct class]]) {
                                        // Wrong kind of value.
                                        return CHIP_ERROR_INVALID_ARGUMENT;
                                    }
                                    auto element_4 = (MCContentLauncherClusterAdditionalInfoStruct *) element_1.externalIDList[i_4];
                                    listHolder_4->mList[i_4].name = AsCharSpan(element_4.name);
                                    listHolder_4->mList[i_4].value = AsCharSpan(element_4.value);
                                }
                                definedValue_3 = ListType_4(listHolder_4->mList, element_1.externalIDList.count);
                            } else {
                                definedValue_3 = ListType_4();
                            }
                        }
                    }
                }
                cppStruct.search.parameterList = ListType_1(listHolder_1->mList, self.search.parameterList.count);
            } else {
                cppStruct.search.parameterList = ListType_1();
            }
        }
    }
    {
        cppStruct.autoPlay = self.autoPlay.boolValue;
    }
    {
        if (self.data != nil) {
            auto & definedValue_0 = cppStruct.data.Emplace();
            definedValue_0 = AsCharSpan(self.data);
        }
    }
    {
        if (self.playbackPreferences != nil) {
            auto & definedValue_0 = cppStruct.playbackPreferences.Emplace();
            definedValue_0.playbackPosition = self.playbackPreferences.playbackPosition.unsignedLongLongValue;
            definedValue_0.textTrack.languageCode = AsCharSpan(self.playbackPreferences.textTrack.languageCode);
            if (self.playbackPreferences.textTrack.characteristics != nil) {
                auto & definedValue_3 = definedValue_0.textTrack.characteristics.Emplace();
                {
                    using ListType_4 = std::remove_reference_t<decltype(definedValue_3)>;
                    using ListMemberType_4 = ListMemberTypeGetter<ListType_4>::Type;
                    if (self.playbackPreferences.textTrack.characteristics.count != 0) {
                        auto * listHolder_4 = new ListHolder<ListMemberType_4>(self.playbackPreferences.textTrack.characteristics.count);
                        if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) {
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        listFreer.add(listHolder_4);
                        for (size_t i_4 = 0; i_4 < self.playbackPreferences.textTrack.characteristics.count; ++i_4) {
                            if (![self.playbackPreferences.textTrack.characteristics[i_4] isKindOfClass:[NSNumber class]]) {
                                // Wrong kind of value.
                                return CHIP_ERROR_INVALID_ARGUMENT;
                            }
                            auto element_4 = (NSNumber *) self.playbackPreferences.textTrack.characteristics[i_4];
                            listHolder_4->mList[i_4] = static_cast<std::remove_reference_t<decltype(listHolder_4->mList[i_4])>>(element_4.unsignedCharValue);
                        }
                        definedValue_3 = ListType_4(listHolder_4->mList, self.playbackPreferences.textTrack.characteristics.count);
                    } else {
                        definedValue_3 = ListType_4();
                    }
                }
            }
            definedValue_0.textTrack.audioOutputIndex = self.playbackPreferences.textTrack.audioOutputIndex.unsignedCharValue;
            if (self.playbackPreferences.audioTracks != nil) {
                auto & definedValue_2 = definedValue_0.audioTracks.Emplace();
                {
                    using ListType_3 = std::remove_reference_t<decltype(definedValue_2)>;
                    using ListMemberType_3 = ListMemberTypeGetter<ListType_3>::Type;
                    if (self.playbackPreferences.audioTracks.count != 0) {
                        auto * listHolder_3 = new ListHolder<ListMemberType_3>(self.playbackPreferences.audioTracks.count);
                        if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) {
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        listFreer.add(listHolder_3);
                        for (size_t i_3 = 0; i_3 < self.playbackPreferences.audioTracks.count; ++i_3) {
                            if (![self.playbackPreferences.audioTracks[i_3] isKindOfClass:[MCContentLauncherClusterTrackPreferenceStruct class]]) {
                                // Wrong kind of value.
                                return CHIP_ERROR_INVALID_ARGUMENT;
                            }
                            auto element_3 = (MCContentLauncherClusterTrackPreferenceStruct *) self.playbackPreferences.audioTracks[i_3];
                            listHolder_3->mList[i_3].languageCode = AsCharSpan(element_3.languageCode);
                            if (element_3.characteristics != nil) {
                                auto & definedValue_5 = listHolder_3->mList[i_3].characteristics.Emplace();
                                {
                                    using ListType_6 = std::remove_reference_t<decltype(definedValue_5)>;
                                    using ListMemberType_6 = ListMemberTypeGetter<ListType_6>::Type;
                                    if (element_3.characteristics.count != 0) {
                                        auto * listHolder_6 = new ListHolder<ListMemberType_6>(element_3.characteristics.count);
                                        if (listHolder_6 == nullptr || listHolder_6->mList == nullptr) {
                                            return CHIP_ERROR_INVALID_ARGUMENT;
                                        }
                                        listFreer.add(listHolder_6);
                                        for (size_t i_6 = 0; i_6 < element_3.characteristics.count; ++i_6) {
                                            if (![element_3.characteristics[i_6] isKindOfClass:[NSNumber class]]) {
                                                // Wrong kind of value.
                                                return CHIP_ERROR_INVALID_ARGUMENT;
                                            }
                                            auto element_6 = (NSNumber *) element_3.characteristics[i_6];
                                            listHolder_6->mList[i_6] = static_cast<std::remove_reference_t<decltype(listHolder_6->mList[i_6])>>(element_6.unsignedCharValue);
                                        }
                                        definedValue_5 = ListType_6(listHolder_6->mList, element_3.characteristics.count);
                                    } else {
                                        definedValue_5 = ListType_6();
                                    }
                                }
                            }
                            listHolder_3->mList[i_3].audioOutputIndex = element_3.audioOutputIndex.unsignedCharValue;
                        }
                        definedValue_2 = ListType_3(listHolder_3->mList, self.playbackPreferences.audioTracks.count);
                    } else {
                        definedValue_2 = ListType_3();
                    }
                }
            }
        }
    }
    {
        if (self.useCurrentContext != nil) {
            auto & definedValue_0 = cppStruct.useCurrentContext.Emplace();
            definedValue_0 = self.useCurrentContext.boolValue;
        }
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCContentLauncherClusterLaunchURLParams
- (instancetype)init
{
    if (self = [super init]) {

        _contentURL = @"";

        _displayString = nil;

        _brandingInformation = nil;
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCContentLauncherClusterLaunchURLParams alloc] init];

    other.contentURL = self.contentURL;
    other.displayString = self.displayString;
    other.brandingInformation = self.brandingInformation;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: contentURL:%@; displayString:%@; brandingInformation:%@; >", NSStringFromClass([self class]), _contentURL, _displayString, _brandingInformation];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type cppStruct;
    ListFreer listFreer;
    {
        cppStruct.contentURL = AsCharSpan(self.contentURL);
    }
    {
        if (self.displayString != nil) {
            auto & definedValue_0 = cppStruct.displayString.Emplace();
            definedValue_0 = AsCharSpan(self.displayString);
        }
    }
    {
        if (self.brandingInformation != nil) {
            auto & definedValue_0 = cppStruct.brandingInformation.Emplace();
            definedValue_0.providerName = AsCharSpan(self.brandingInformation.providerName);
            if (self.brandingInformation.background != nil) {
                auto & definedValue_2 = definedValue_0.background.Emplace();
                if (self.brandingInformation.background.imageURL != nil) {
                    auto & definedValue_4 = definedValue_2.imageURL.Emplace();
                    definedValue_4 = AsCharSpan(self.brandingInformation.background.imageURL);
                }
                if (self.brandingInformation.background.color != nil) {
                    auto & definedValue_4 = definedValue_2.color.Emplace();
                    definedValue_4 = AsCharSpan(self.brandingInformation.background.color);
                }
                if (self.brandingInformation.background.size != nil) {
                    auto & definedValue_4 = definedValue_2.size.Emplace();
                    definedValue_4.width = self.brandingInformation.background.size.width.doubleValue;
                    definedValue_4.height = self.brandingInformation.background.size.height.doubleValue;
                    definedValue_4.metric = static_cast<std::remove_reference_t<decltype(definedValue_4.metric)>>(self.brandingInformation.background.size.metric.unsignedCharValue);
                }
            }
            if (self.brandingInformation.logo != nil) {
                auto & definedValue_2 = definedValue_0.logo.Emplace();
                if (self.brandingInformation.logo.imageURL != nil) {
                    auto & definedValue_4 = definedValue_2.imageURL.Emplace();
                    definedValue_4 = AsCharSpan(self.brandingInformation.logo.imageURL);
                }
                if (self.brandingInformation.logo.color != nil) {
                    auto & definedValue_4 = definedValue_2.color.Emplace();
                    definedValue_4 = AsCharSpan(self.brandingInformation.logo.color);
                }
                if (self.brandingInformation.logo.size != nil) {
                    auto & definedValue_4 = definedValue_2.size.Emplace();
                    definedValue_4.width = self.brandingInformation.logo.size.width.doubleValue;
                    definedValue_4.height = self.brandingInformation.logo.size.height.doubleValue;
                    definedValue_4.metric = static_cast<std::remove_reference_t<decltype(definedValue_4.metric)>>(self.brandingInformation.logo.size.metric.unsignedCharValue);
                }
            }
            if (self.brandingInformation.progressBar != nil) {
                auto & definedValue_2 = definedValue_0.progressBar.Emplace();
                if (self.brandingInformation.progressBar.imageURL != nil) {
                    auto & definedValue_4 = definedValue_2.imageURL.Emplace();
                    definedValue_4 = AsCharSpan(self.brandingInformation.progressBar.imageURL);
                }
                if (self.brandingInformation.progressBar.color != nil) {
                    auto & definedValue_4 = definedValue_2.color.Emplace();
                    definedValue_4 = AsCharSpan(self.brandingInformation.progressBar.color);
                }
                if (self.brandingInformation.progressBar.size != nil) {
                    auto & definedValue_4 = definedValue_2.size.Emplace();
                    definedValue_4.width = self.brandingInformation.progressBar.size.width.doubleValue;
                    definedValue_4.height = self.brandingInformation.progressBar.size.height.doubleValue;
                    definedValue_4.metric = static_cast<std::remove_reference_t<decltype(definedValue_4.metric)>>(self.brandingInformation.progressBar.size.metric.unsignedCharValue);
                }
            }
            if (self.brandingInformation.splash != nil) {
                auto & definedValue_2 = definedValue_0.splash.Emplace();
                if (self.brandingInformation.splash.imageURL != nil) {
                    auto & definedValue_4 = definedValue_2.imageURL.Emplace();
                    definedValue_4 = AsCharSpan(self.brandingInformation.splash.imageURL);
                }
                if (self.brandingInformation.splash.color != nil) {
                    auto & definedValue_4 = definedValue_2.color.Emplace();
                    definedValue_4 = AsCharSpan(self.brandingInformation.splash.color);
                }
                if (self.brandingInformation.splash.size != nil) {
                    auto & definedValue_4 = definedValue_2.size.Emplace();
                    definedValue_4.width = self.brandingInformation.splash.size.width.doubleValue;
                    definedValue_4.height = self.brandingInformation.splash.size.height.doubleValue;
                    definedValue_4.metric = static_cast<std::remove_reference_t<decltype(definedValue_4.metric)>>(self.brandingInformation.splash.size.metric.unsignedCharValue);
                }
            }
            if (self.brandingInformation.waterMark != nil) {
                auto & definedValue_2 = definedValue_0.waterMark.Emplace();
                if (self.brandingInformation.waterMark.imageURL != nil) {
                    auto & definedValue_4 = definedValue_2.imageURL.Emplace();
                    definedValue_4 = AsCharSpan(self.brandingInformation.waterMark.imageURL);
                }
                if (self.brandingInformation.waterMark.color != nil) {
                    auto & definedValue_4 = definedValue_2.color.Emplace();
                    definedValue_4 = AsCharSpan(self.brandingInformation.waterMark.color);
                }
                if (self.brandingInformation.waterMark.size != nil) {
                    auto & definedValue_4 = definedValue_2.size.Emplace();
                    definedValue_4.width = self.brandingInformation.waterMark.size.width.doubleValue;
                    definedValue_4.height = self.brandingInformation.waterMark.size.height.doubleValue;
                    definedValue_4.metric = static_cast<std::remove_reference_t<decltype(definedValue_4.metric)>>(self.brandingInformation.waterMark.size.metric.unsignedCharValue);
                }
            }
        }
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCContentLauncherClusterLauncherResponseParams
- (instancetype)init
{
    if (self = [super init]) {

        _status = @(0);

        _data = nil;
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCContentLauncherClusterLauncherResponseParams alloc] init];

    other.status = self.status;
    other.data = self.data;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, _data];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    // Default implementation
    return CHIP_NO_ERROR;
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse
{
    std::shared_ptr<const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType> responseSharedPtr = std::any_cast<std::shared_ptr<const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType>>(cppResponse);
    const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType cppDecodableStruct = *responseSharedPtr;

    {
        self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)];
    }
    {
        if (cppDecodableStruct.data.HasValue()) {
            self.data = AsString(cppDecodableStruct.data.Value());
            if (self.data == nil) {
                CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT;
                return err;
            }
        } else {
            self.data = nil;
        }
    }
    return CHIP_NO_ERROR;
}
@end

// ApplicationLauncher cluster:

@implementation MCApplicationLauncherClusterLaunchAppParams
- (instancetype)init
{
    if (self = [super init]) {

        _application = nil;

        _data = nil;
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCApplicationLauncherClusterLaunchAppParams alloc] init];

    other.application = self.application;
    other.data = self.data;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; data:%@; >", NSStringFromClass([self class]), _application, [_data base64EncodedStringWithOptions:0]];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type cppStruct;
    ListFreer listFreer;
    {
        if (self.application != nil) {
            auto & definedValue_0 = cppStruct.application.Emplace();
            definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue;
            definedValue_0.applicationID = AsCharSpan(self.application.applicationID);
        }
    }
    {
        if (self.data != nil) {
            auto & definedValue_0 = cppStruct.data.Emplace();
            definedValue_0 = AsByteSpan(self.data);
        }
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCApplicationLauncherClusterStopAppParams
- (instancetype)init
{
    if (self = [super init]) {

        _application = nil;
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCApplicationLauncherClusterStopAppParams alloc] init];

    other.application = self.application;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; >", NSStringFromClass([self class]), _application];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type cppStruct;
    ListFreer listFreer;
    {
        if (self.application != nil) {
            auto & definedValue_0 = cppStruct.application.Emplace();
            definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue;
            definedValue_0.applicationID = AsCharSpan(self.application.applicationID);
        }
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCApplicationLauncherClusterHideAppParams
- (instancetype)init
{
    if (self = [super init]) {

        _application = nil;
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCApplicationLauncherClusterHideAppParams alloc] init];

    other.application = self.application;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: application:%@; >", NSStringFromClass([self class]), _application];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type cppStruct;
    ListFreer listFreer;
    {
        if (self.application != nil) {
            auto & definedValue_0 = cppStruct.application.Emplace();
            definedValue_0.catalogVendorID = self.application.catalogVendorID.unsignedShortValue;
            definedValue_0.applicationID = AsCharSpan(self.application.applicationID);
        }
    }

    return std::any(cppStruct);
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppDecodableStruct
{
    // Default implementation
    return CHIP_NO_ERROR;
}
@end

@implementation MCApplicationLauncherClusterLauncherResponseParams
- (instancetype)init
{
    if (self = [super init]) {

        _status = @(0);

        _data = nil;
    }
    return self;
}

- (id)copyWithZone:(NSZone * _Nullable)zone;
{
    auto other = [[MCApplicationLauncherClusterLauncherResponseParams alloc] init];

    other.status = self.status;
    other.data = self.data;

    return other;
}

- (NSString *)description
{
    NSString * descriptionString = [NSString stringWithFormat:@"<%@: status:%@; data:%@; >", NSStringFromClass([self class]), _status, [_data base64EncodedStringWithOptions:0]];
    return descriptionString;
}

- (std::any)getCppRequestFromObjCRequest
{
    // Default implementation
    return CHIP_NO_ERROR;
}

- (CHIP_ERROR)setObjCResponseFromCppResponse:(std::any)cppResponse
{
    std::shared_ptr<const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType> responseSharedPtr = std::any_cast<std::shared_ptr<const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType>>(cppResponse);
    const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType cppDecodableStruct = *responseSharedPtr;

    {
        self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppDecodableStruct.status)];
    }
    {
        if (cppDecodableStruct.data.HasValue()) {
            self.data = AsData(cppDecodableStruct.data.Value());
        } else {
            self.data = nil;
        }
    }
    return CHIP_NO_ERROR;
}
@end

// ApplicationBasic cluster:

NS_ASSUME_NONNULL_END
